<template>
  <div>
    全名:
    <input type="text" v-model="fullname">
  </div>
</template>

<script>
export default {
  name: 'CodeApp',

  data() {
    return {
      firstname:"甘甘", 
      lastname:"绿绿"
    };
  },
  computed: {
    fullname:{
      // 赋值时触发set
      set(val){
        console.log(val);
    },
    // 调用值时触发get
    get(){
      return this.firstname+this.lastname;
      }
    }
  },
  mounted() {
    
  },

  methods: {
    
  },
};
</script>

<style lang="scss" scoped>

</style>